<div id="box-wrapper">
    <div id="top-left"></div>
    <div id="top-right"></div>
    <div id="top-center"></div>
    <div id="main-left"></div>        
    <div id="main-right"></div>        
    <div id="bottom-left"></div>        
    <div id="bottom-right"></div>        
    <div id="bottom-center"></div>
    <div id="box-content">                    
        <div class="header">
            <div class="logo">
                <div class="inner">
                    <h1>Available Modules</h1><br /><span>Select the modules to install (may be add later)</span>
                </div>
            </div>
            <h2>Add more to your site</h2>                            
        </div>
        <p>Ximent, occatem volo ipiendis reius resecti aspedi aute earum facepudis im dolum acipsapis velibus. Itatur? Rorument aut quate eaquam nus rero ommodi tem faccus minti odicat.Tem. Ut rectibus sum ad mos am hil magnatur atecuscid utatum qui sequia voluptas asped etum, consed ut repro et explicia consequisi officiures solescia sequae omnit enis ipitae nimi, nulligenia </p>
        <div class="form">
            <form id="form-select-modules" method="post" action="<?php if($siteInfo->layout=='template') $nextRoute = '/FrontDesk/site/addProfile'; else $nextRoute = '/FrontDesk/site/setupDomain'; echo $this->createUrl($nextRoute); ?>">
                <?php
                echo $siteInfo->showAttributesHiddenFields(array('modules'));
                $modules = CmsModule::model()->findAll('status=1');
                if (count($modules) > 0) :
                ?>
                    <ul class="items">
                    <?php foreach($modules as $module) : ?>
                        <li>
                            <div>
                                <input type="checkbox" class="checkbox" name="SiteInfo[modules][]" value="<?php echo $module->name; ?>"<?php if (is_array($siteInfo->modules) && in_array($module->name,$siteInfo->modules)) echo ' checked="checked"'; ?> />
                                <?php
                                if (!empty($module->logo)) :
                                    $logoPath = baseUrl().'/uploads/modules/'.$module->logo; 
                                ?>
                                    <img class="module-logo" border="0" width="27" height="27" src="<?php echo $logoPath; ?>" />
                                <?php endif; ?>
                                <h3><?php echo $module->friendly_name; ?></h3>
                                <div class="link">
                                    <span class="hiding"></span>
                                    <a href="#">Learn more</a>
                                </div>
                                <div class="expand-panel">
                                    <?php
                                    $moduleImages = CmsModuleImage::model()->findAll('cms_module_id=:moduleId',array(':moduleId'=>$module->id));
                                    if (count($moduleImages) > 0) :
                                    ?>
                                        <div class="thumbnails">
                                            <div class="selected-thumbnail">
                                                <?php
                                                $imagePath = baseUrl().'/uploads/modules/'.$moduleImages[0]->image;
                                                ?>
                                                <img src="<?php echo $imagePath; ?>" border="0" width="187" height="225" />
                                            </div>
                                        </div>
                                    <?php endif; ?>
                                    <div class="content">
                                        <h4><?php echo $module->friendly_name; ?></h4>
                                        <?php echo $module->description; ?>
                                    </div>
                                </div>
                            </div>
                        </li>
                    <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
                <div class="row buttons">
                    <a href="#" class="question-button"></a>
                    <div class="button">
                        <span>
                            <input type="submit" value="<?php if($siteInfo->layout=='template') echo 'Step [5 of 6]'; else echo 'Step [2 of 3]'; ?>" />
                        </span>
                    </div>
                    <div class="button">
                        <span>
                            <a href="#" id="lnk-back-to-previous">Back</a>
                        </span>
                    </div>                            
                </div>
                <script type="text/javascript">
                $('#lnk-back-to-previous').click(function(){
                    $('#form-select-modules').attr('action','<?php if($siteInfo->layout=='template') $prevRoute = '/FrontDesk/site/uploadLogo'; else $prevRoute = '/FrontDesk/site/add'; echo $this->createUrl($prevRoute); ?>').submit();
                    return false;    
                }); 
                </script>
            </form>                    
        </div>                
    </div>
</div>